<extend name="Public/base" />

<block name="body">
    
    <div class="row">
		<div class="col-md-12">
            
			<div class="tabbable tabbable-custom boxless">
                <form id="form" action="{:U()}" method="post" class="form-1">
				<div class="tab-content">
                    <div class="portlet box red">
                        <div class="portlet-title">
                            <div class="caption"><i class="fa fa-reorder"></i> {$info['id']?'编辑':'新增'}配置 </div>
                            <div class="tools">
                                <a href="javascript:;" class="collapse"></a>
                                <a href="#portlet-config" data-toggle="modal" class="config"></a>
                                <a href="javascript:;" class="reload"></a>
                                <a href="javascript:;" class="remove"></a>
                            </div>
                        </div>
                        <div class="portlet-body form">
                            <!-- BEGIN FORM-->
                            
                            <div class="form-body">
                                
                                <div class="form-group">
                                    <label>配置标识<span class="check-tips">（用于C函数调用，只能使用英文且不能重复）</span></label>
                                    <input type="text" class="form-control input-xlarge" name="name" value="{$info.name|default=''}">
                                </div>
                                <div class="form-group">
                                    <label>配置标题<span class="check-tips">（用于后台显示的配置标题）</span></label>
                                    <input type="text" class="form-control input-xlarge" name="title" value="{$info.title|default=''}">
                                </div>
                                <div class="form-group">
                                    <label>排序<span class="check-tips">（用于分组显示的顺序）</span></label>
                                    <input type="text" class="form-control input-xlarge" name="sort" value="{$info.sort|default=0}">
                                </div>
                                <div class="form-group">
                                    <label>配置类型<span class="check-tips">（系统会根据不同类型解析配置值）</span></label>
                                    <select class="form-control input-medium" name="type">
                                    <volist name="Think.config.CONFIG_TYPE_LIST" id="type">
                                        <option value="{$key}" <eq name="info.type" value="$key">selected</eq> >{$type}</option>
                                    </volist>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>配置分组<span class="check-tips">（配置分组 用于批量设置 不分组则不会显示在系统设置中）</span></label>
                                    <select class="form-control input-medium" name="group">
                                        <option value="0">不分组</option>
                                        <volist name="Think.config.CONFIG_GROUP_LIST" id="group">
                                            <option value="{$key}" <eq name="info.group" value="$key">selected</eq>>{$group}</option>
                                        </volist>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>配置值<span class="check-tips">（配置值）</span></label>
                                    <textarea class="form-control input-xlarge" rows="3"  name="value" >{$info.value|default=''}</textarea>
                                </div>
                                <div class="form-group">
                                    <label>配置项<span class="check-tips">（如果是枚举型 需要配置该项）</span></label>
                                    <textarea class="form-control input-xlarge" rows="3"  name="extra" >{$info.extra|default=''}</textarea>
                                </div>
                                <div class="form-group">
                                    <label>说明<span class="check-tips">（配置详细说明）</span></label>
                                    <textarea class="form-control input-xlarge" rows="3"  name="remark" >{$info.remark|default=''}</textarea>
                                </div>
          
                            </div>
                            
                            
                            <div class="form-actions fluid ">
                                <div class="col-md-offset-3 col-md-9">
                                    <input type="hidden" name="id" value="{$info.id|default=''}">
                                    <button class="btn green submit-btn ajax-post" id="submit" type="submit" target-form="form-1">确 定</button>
                                    <button class="btn default btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>                       
                                </div>
                            </div>
                            
                            <!-- END FORM--> 
                        </div>
                    </div>
				</div>
                
                </form>
			</div>
		</div>
	</div>
</block>

<block name="script">
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="__STATIC__/scripts/app.js"></script>
    <!-- END PAGE LEVEL SCRIPTS -->
    <script>
    jQuery(document).ready(function() {       
    	// initiate layout and plugins
    	App.init();

        highlight_subnav('{:U('Config/index')}');
    });
    </script>
</block>
